# coding: utf-8

from flask_bootstrap import Bootstrap
from flask_mail import Mail
from flask_sqlalchemy import SQLAlchemy
from flask_login import LoginManager
from flask_marshmallow import Marshmallow
from flask_apscheduler import APScheduler

from app.wph_lib.im import IMSyncProxy
from app.wph_lib.user import UserSyncProxy
from app.wph_lib.qiniu import QiNiuProxy

bootstrap = Bootstrap()
mail = Mail()
db = SQLAlchemy()
ma = Marshmallow()

login_manager = LoginManager()
# NOTE by chenhj 如果使用strong的话, 经常在短时间退出会话, 暂不知道原因
# login_manager.session_protection = 'strong'
login_manager.login_view = 'auth_bp.login'
scheduler = APScheduler()
im_sync_proxy = IMSyncProxy()
user_sync_proxy = UserSyncProxy()
qi_niu_proxy = QiNiuProxy()
